<template>
  <view class="normal-login-container">

    <view class="item-wrap" style="margin-bottom: 0">
      <view class="lineBottom10">
        <uni-section title="基础信息" type="line"/>
      </view>

      <view style="margin: 8rpx 20rpx 8rpx 20rpx">
        <uni-forms labelWidth="auto">
          <uni-forms-item label="客户名称:">
            <text>{{ ruleForm.customerName || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="合同禀议号:">
            <text>{{ ruleForm.contractReportNumber || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="采购禀议号:">
            <text>{{ ruleForm.procurementReportNumber || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆产权:">
            <text>{{ ruleForm.propertyRightName || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆归属:">
            <text>{{ ruleForm.ascription || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆运营城市:">
            <text>{{ ruleForm.operationsName || '-'}}</text>
          </uni-forms-item>
          <uni-forms-item label="车辆大区:">
            <text>{{ ruleForm.region || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="品牌/车系/车型:">
            <text v-if="ruleForm.brandName">{{ ruleForm.brandName }}/</text>
            <text v-if="ruleForm.seriesName">{{ ruleForm.seriesName }}/</text>
            <text>{{ ruleForm.modelName }}</text>
          </uni-forms-item>

          <uni-forms-item label="车架号:">
            <text>{{ ruleForm.vinNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车牌号:">
            <text>{{ ruleForm.carNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆状态:">
            <text>{{ handleLabel(dict.type.car_business_type, ruleForm.businessType) }}</text>
          </uni-forms-item>

          <uni-forms-item label="产品类型:">
            <text>{{ handleLabel(dict.type.quota_rent_type, ruleForm.contractType) }}</text>
          </uni-forms-item>

          <uni-forms-item label="处理人:">
            <text>{{ ruleForm.processedByName || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="处理时间:">
            <text>{{ ruleForm.processedByTime || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="工单创建时间:">
            <text>{{ ruleForm.workCreateTime || '-' }}</text>
          </uni-forms-item>

          <view style="margin-bottom: 20rpx">
            <text style="font-size: 30rpx;">精品装饰说明:</text>
          </view>

          <uni-table ref="table" border stripe emptyText="暂无更多数据">
            <uni-tr>
              <uni-th width="130" align="center">项目</uni-th>
              <uni-th width="120" align="center">单车预算金额</uni-th>
              <uni-th width="150" align="center">说明</uni-th>
            </uni-tr>
            <uni-tr v-for="(item, index) in ruleForm.decorateProList" :key="index">

              <uni-td align="center">
                <text>{{ item.decorateName || '-'}}</text>
              </uni-td>

              <uni-td align="center">
                <text>{{ item.budgetPrice || ''}}</text>
              </uni-td>

              <uni-td align="center">
                <text>{{ item.remark || '-'}}</text>
              </uni-td>


            </uni-tr>
          </uni-table>

        </uni-forms>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'basicInfo',//基础信息
  dicts: ['customer_type', 'car_business_type','quota_rent_type'],
  props: {
    value: {
      type: Object,
      default: {}
    },
    boole: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    ruleForm: {
      get() {
        let that = this
        const proxy = new Proxy(that.value, {
          get(target, key) {
            return Reflect.get(target, key)
          },
          set(target, key, value) {
            that.$emit('input', {...target, [key]: value})
            return true
          }
        })
        return proxy
      }
    },
    handleLabel() {
      return function (arr, type) {
        let name = '-'
        arr.map((v) => {
          if (type == v.value) {
            name = v.label;
          }
        });
        return name
      }
    }
  },
  watch: {},
  data() {
    return {};
  },
  created() {
  },
  mounted() {
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.car-wrap {
  display: flex;
  flex-direction: column;
  padding: 20rpx 20rpx 20rpx 0;
  border: 1px solid #dadada;
  margin: 10rpx 20rpx;
  border-radius: 8rpx;

}


</style>


